package com.ydy.config;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Slf4j
@Component
public class LogAdvice {
    @Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)")
    private void logAdvicePointcut(){}
    @Before("logAdvicePointcut()")
    public void  logAdvice(){
        log.info("get请求的advice触发了");

    }
    @After("logAdvicePointcut()")
    public  void logAfterAdvice(){
        log.info("get请求的advice触发结束l");
    }
}
